package com.example.cms2.Mapper;

import com.example.cms2.pojo.Employee;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @return
 */
@Mapper
public interface EmployeeMapper {
    @Select("select * from employee")
    public List<Employee> getAll();

    @Insert("insert into employee values(null,#{lastName},#{email},#{gender},#{department},#{birth})")
    public int insertEmp(Employee employee);

    @Update("update employee set lastName=#{lastName},email=#{email},gender=#{gender},department=#{department},birth=#{birth} where id=#{id}")
    public int updateEmpById(Employee employee);

    @Select("select * from employee where id=#{id}")
    public Employee getEmpById(int id);

    @Delete("delete from employee where id=#{id}")
    public int deleteEmpById(int id);
}
